/**
 * Copyright (C) 2010 Cloudfarming <info@cloudfarming.nl>
 *
 * Licensed under the Eclipse Public License - v 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nl.cloudfarming.client.sensor.greenseeker;

import java.io.Serializable;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import nl.cloudfarming.client.model.SensorData;
import nl.cloudfarming.client.model.SensorDataFile;


/**
 *
 * @author Merijn Zengers
 */
@Entity
@DiscriminatorValue("greenseeker")
public class GreenseekerSensorData extends SensorData implements Serializable{

    private double heading;
    private double elevation;
    private double ndvi;
    private double vi_2nd;
    private double red_53;
    private double nir_53;
    private double red_54;
    private double nir_54;
    private double red_55;
    private double nir_55;
    private double red_56;
    private double nir_56;
    private double red_57;
    private double nir_57;
    private double red_58;
    private double nir_58;
    private double sensor_10;
    private double sensor_19;
    private double sensor_23;
    private double sensor_24;
    private double sensor_26;
    private double sensor_73;

    /**
     * For JPA use only.
     */
    public GreenseekerSensorData(){
    }


     /**
     * Constructor for creating a Borne GreenseekerSensorDataBO
     */
    public GreenseekerSensorData(SensorDataFile dataFile, double longitude, double latitude,
            double speed, double heading, double elevation, double ndvi, double vi_2nd, double red_53, double nir_53, double red_54, double nir_54, double red_55, double nir_55,
            double red_56, double nir_56, double red_57, double nir_57, double red_58, double nir_58) {

        super(dataFile, longitude, latitude);
        setSpeed(speed);
        this.heading = heading;
        this.elevation = elevation;
        this.ndvi = ndvi;
        this.vi_2nd = vi_2nd;
        this.red_53 = red_53;
        this.nir_53 = nir_53;
        this.red_54 = red_54;
        this.nir_54 = nir_54;
        this.red_55 = red_55;
        this.nir_55 = nir_55;
        this.red_56 = red_56;
        this.nir_56 = nir_56;
        this.red_57 = red_57;
        this.nir_57 = nir_57;
        this.red_58 = red_58;
        this.nir_58 = nir_58;
    }

     /**
     * Constructor for creating a normal GreenseekerSensorDataBO
     */
    public GreenseekerSensorData(SensorDataFile dataFile, double longitude, double latitude,
            double speed, double heading, double elevation, double ndvi, double vi_2nd,
            double sensor_10, double sensor_19, double sensor_23, double sensor_24, double sensor_26, double sensor_73) {
        super(dataFile, longitude, latitude);
        setSpeed(speed);
        this.heading = heading;
        this.elevation = elevation;
        this.ndvi = ndvi;
        this.vi_2nd = vi_2nd;
        this.sensor_10 = sensor_10;
        this.sensor_19 = sensor_19;
        this.sensor_23 = sensor_23;
        this.sensor_24 = sensor_24;
        this.sensor_26 = sensor_26;
        this.sensor_73 = sensor_73;
    }

    public double getElevation() {
        return elevation;
    }

    public void setElevation(double elevation) {
        this.elevation = elevation;
    }

    public double getHeading() {
        return heading;
    }

    public void setHeading(double heading) {
        this.heading = heading;
    }

    public double getNdvi() {
        return ndvi;
    }

    public void setNdvi(double ndvi) {
        this.ndvi = ndvi;
    }

    public double getNir_53() {
        return nir_53;
    }

    public void setNir_53(double nir_53) {
        this.nir_53 = nir_53;
    }

    public double getNir_54() {
        return nir_54;
    }

    public void setNir_54(double nir_54) {
        this.nir_54 = nir_54;
    }

    public double getNir_55() {
        return nir_55;
    }

    public void setNir_55(double nir_55) {
        this.nir_55 = nir_55;
    }

    public double getNir_56() {
        return nir_56;
    }

    public void setNir_56(double nir_56) {
        this.nir_56 = nir_56;
    }

    public double getNir_57() {
        return nir_57;
    }

    public void setNir_57(double nir_57) {
        this.nir_57 = nir_57;
    }

    public double getNir_58() {
        return nir_58;
    }

    public void setNir_58(double nir_58) {
        this.nir_58 = nir_58;
    }

    public double getRed_53() {
        return red_53;
    }

    public void setRed_53(double red_53) {
        this.red_53 = red_53;
    }

    public double getRed_54() {
        return red_54;
    }

    public void setRed_54(double red_54) {
        this.red_54 = red_54;
    }

    public double getRed_55() {
        return red_55;
    }

    public void setRed_55(double red_55) {
        this.red_55 = red_55;
    }

    public double getRed_56() {
        return red_56;
    }

    public void setRed_56(double red_56) {
        this.red_56 = red_56;
    }

    public double getRed_57() {
        return red_57;
    }

    public void setRed_57(double red_57) {
        this.red_57 = red_57;
    }

    public double getRed_58() {
        return red_58;
    }

    public void setRed_58(double red_58) {
        this.red_58 = red_58;
    }

    public double getSensor_10() {
        return sensor_10;
    }

    public void setSensor_10(double sensor_10) {
        this.sensor_10 = sensor_10;
    }

    public double getSensor_19() {
        return sensor_19;
    }

    public void setSensor_19(double sensor_19) {
        this.sensor_19 = sensor_19;
    }

    public double getSensor_23() {
        return sensor_23;
    }

    public void setSensor_23(double sensor_23) {
        this.sensor_23 = sensor_23;
    }

    public double getSensor_24() {
        return sensor_24;
    }

    public void setSensor_24(double sensor_24) {
        this.sensor_24 = sensor_24;
    }

    public double getSensor_26() {
        return sensor_26;
    }

    public void setSensor_26(double sensor_26) {
        this.sensor_26 = sensor_26;
    }

    public double getSensor_73() {
        return sensor_73;
    }

    public void setSensor_73(double sensor_73) {
        this.sensor_73 = sensor_73;
    }

    public double getVi_2nd() {
        return vi_2nd;
    }

    public void setVi_2nd(double vi_2nd) {
        this.vi_2nd = vi_2nd;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final GreenseekerSensorData other = (GreenseekerSensorData) obj;
       /*if (this.greenSeekerSensorDataID != other.greenSeekerSensorDataID) {
            return false;
        }

        if (this.geoDataSensorFile != other.geoDataSensorFile && (this.geoDataSensorFile == null || !this.geoDataSensorFile.equals(other.geoDataSensorFile))) {
            return false;
        }
        if (this.sensorRun != other.sensorRun && (this.sensorRun == null || !this.sensorRun.equals(other.sensorRun))) {
            return false;
        }*/
        if (Double.doubleToLongBits(this.getLongtitude()) != Double.doubleToLongBits(other.getLongtitude())) {
            return false;
        }
        if (Double.doubleToLongBits(this.getLatitude()) != Double.doubleToLongBits(other.getLatitude())) {
            return false;
        }
        if (Double.doubleToLongBits(this.heading) != Double.doubleToLongBits(other.heading)) {
            return false;
        }
        if (Double.doubleToLongBits(this.elevation) != Double.doubleToLongBits(other.elevation)) {
            return false;
        }
        if (Double.doubleToLongBits(this.ndvi) != Double.doubleToLongBits(other.ndvi)) {
            return false;
        }
        if (Double.doubleToLongBits(this.vi_2nd) != Double.doubleToLongBits(other.vi_2nd)) {
            return false;
        }
        if (Double.doubleToLongBits(this.red_54) != Double.doubleToLongBits(other.red_54)) {
            return false;
        }
        if (Double.doubleToLongBits(this.nir_54) != Double.doubleToLongBits(other.nir_54)) {
            return false;
        }

        if (Double.doubleToLongBits(this.red_55) != Double.doubleToLongBits(other.red_55)) {
            return false;
        }
        if (Double.doubleToLongBits(this.nir_55) != Double.doubleToLongBits(other.nir_55)) {
            return false;
        }
        if (Double.doubleToLongBits(this.red_57) != Double.doubleToLongBits(other.red_57)) {
            return false;
        }
        if (Double.doubleToLongBits(this.nir_57) != Double.doubleToLongBits(other.nir_57)) {
            return false;
        }
        if (Double.doubleToLongBits(this.red_53) != Double.doubleToLongBits(other.red_53)) {
            return false;
        }
        if (Double.doubleToLongBits(this.nir_53) != Double.doubleToLongBits(other.nir_53)) {
            return false;
        }
        if (Double.doubleToLongBits(this.red_56) != Double.doubleToLongBits(other.red_56)) {
            return false;
        }
        if (Double.doubleToLongBits(this.nir_56) != Double.doubleToLongBits(other.nir_56)) {
            return false;
        }
        if (Double.doubleToLongBits(this.red_58) != Double.doubleToLongBits(other.red_58)) {
            return false;
        }
        if (Double.doubleToLongBits(this.nir_58) != Double.doubleToLongBits(other.nir_58)) {
            return false;
        }
        if (Double.doubleToLongBits(this.sensor_10) != Double.doubleToLongBits(other.sensor_10)) {
            return false;
        }
        if (Double.doubleToLongBits(this.sensor_23) != Double.doubleToLongBits(other.sensor_23)) {
            return false;
        }
        if (Double.doubleToLongBits(this.sensor_73) != Double.doubleToLongBits(other.sensor_73)) {
            return false;
        }
        if (Double.doubleToLongBits(this.sensor_19) != Double.doubleToLongBits(other.sensor_19)) {
            return false;
        }
        if (Double.doubleToLongBits(this.sensor_24) != Double.doubleToLongBits(other.sensor_24)) {
            return false;
        }
        if (Double.doubleToLongBits(this.sensor_26) != Double.doubleToLongBits(other.sensor_26)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        /*hash = 41 * hash + (int) (this.greenSeekerSensorDataID ^ (this.greenSeekerSensorDataID >>> 32));
        hash = 41 * hash + (this.greenSeekerSensorFile != null ? this.greenSeekerSensorFile.hashCode() : 0);
        hash = 41 * hash + (this.sensorRun != null ? this.sensorRun.hashCode() : 0);*/
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.getLongtitude()) ^ (Double.doubleToLongBits(this.getLongtitude()) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.getLatitude()) ^ (Double.doubleToLongBits(this.getLatitude()) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.heading) ^ (Double.doubleToLongBits(this.heading) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.elevation) ^ (Double.doubleToLongBits(this.elevation) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.ndvi) ^ (Double.doubleToLongBits(this.ndvi) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.vi_2nd) ^ (Double.doubleToLongBits(this.vi_2nd) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.red_54) ^ (Double.doubleToLongBits(this.red_54) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.nir_54) ^ (Double.doubleToLongBits(this.nir_54) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.red_55) ^ (Double.doubleToLongBits(this.red_55) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.nir_55) ^ (Double.doubleToLongBits(this.nir_55) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.red_57) ^ (Double.doubleToLongBits(this.red_57) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.nir_57) ^ (Double.doubleToLongBits(this.nir_57) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.red_53) ^ (Double.doubleToLongBits(this.red_53) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.nir_53) ^ (Double.doubleToLongBits(this.nir_53) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.red_56) ^ (Double.doubleToLongBits(this.red_56) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.nir_56) ^ (Double.doubleToLongBits(this.nir_56) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.red_58) ^ (Double.doubleToLongBits(this.red_58) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.nir_58) ^ (Double.doubleToLongBits(this.nir_58) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.sensor_10) ^ (Double.doubleToLongBits(this.sensor_10) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.sensor_23) ^ (Double.doubleToLongBits(this.sensor_23) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.sensor_73) ^ (Double.doubleToLongBits(this.sensor_73) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.sensor_19) ^ (Double.doubleToLongBits(this.sensor_19) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.sensor_24) ^ (Double.doubleToLongBits(this.sensor_24) >>> 32));
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.sensor_26) ^ (Double.doubleToLongBits(this.sensor_26) >>> 32));
        return hash;
    }


}
